package com.java.main.service;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.java.main.controller.input.PageInput;
import com.java.main.domain.SysEntity.SysEntityAuto;

public interface SysBaseService<T, ID extends Serializable> {
	public void add(SysEntityAuto entity);

	public void update(SysEntityAuto t);

	public void del(Integer id);

	public void del(SysEntityAuto entity);

	public T findOne(Map<String, Object> param);

	/**
	 * 根据sql查询一条数据
	 * @param sql
	 * @return
	 */
	public T findOneBySql( String sql);
	public T findOneById(Integer id);

	public List<T> findByPage(PageInput input);

	public Integer countByPage(PageInput input);

	public List<T> find(Map<String, Object> param);

	public List<T> find(Map<String, Object> param, String sortField, String sortOrder);

	public List<T> findOrderBy(Map<String, Object> param, String sortField, String sortOrder);

	public Integer count(Map<String, Object> param);

	public List<T> findAll();

	public Integer countAll();

}
